// 创建服务器
const express = require('express');
const app = express();
app.listen(3000, () => {
    console.log('服务器已开启');
})
//引入mysquery
const myquery = require('./fz');
const path = require('path');

app.get('/', (req, res) => {
    res.sendFile(path.join(__dirname, '1.前端页面.html'))
})



app.get('/index', async (req, res) => {

    let sql = `select*from trade `;

    let [err, result] = await myquery(sql);
  
    res.send(result);
    

})